package com.ws.mapper;

import com.ws.bean.Friendlinks;
import com.ws.bean.vo.FriendlinkVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FriendlinkMapper {

    List<Friendlinks> list(FriendlinkVo friendlinkVo);

    @Insert("insert into friendlinks(link_name,link_url,create_time,update_time) values(#{link_name},#{link_url},now(),now())")
    int add(Friendlinks friendlinks);

    @Delete("delete from friendlinks where link_id=#{id}")
    int delete(Integer id);

    @Select("select * from friendlinks where link_id=#{link_id}")
    Friendlinks selFriendlinkOne(Integer id);

    @Update("update friendlinks set link_name=#{link_name},link_url=#{link_url},update_time=now() where link_id=#{link_id}")
    int update(Friendlinks friendlinks);
}
